package com.zxb.user.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;

import java.util.UUID;

public class FeignAuthRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        //业务逻辑，模拟认证逻辑
        String token = UUID.randomUUID().toString();
        //设置token
        requestTemplate.header("Authorization",token);
    }
}
